package com.cxs.service.impl;

import com.cxs.anno.MqttService;
import com.cxs.anno.MqttTopic;
import com.cxs.handle.MqttHandler;
import com.cxs.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Service;

@MqttService
@Service
@Slf4j
public class UserServiceImpl implements UserService, MqttHandler {


    @MqttTopic("user/#")
    public void user(Message<?> message) {
        log.info("user=" + message.getPayload());
        addUser();
    }


    @Override
    public void addUser() {
        log.info("新增用户");
    }
}